﻿package 
{
	//WEEK 02
	import flash.display.MovieClip;
	import flash.display.FrameLabel;
	import flash.events.*;
	import flash.text.TextField;
	
	
	public class GameDoc extends MovieClip{
		static public const MENU:String = "menu";
		static public const GAME:String = "game";
		static public const END:String = "results";
        static public const CLICK:String = "_down";
		static public const OVER:String = "_over";
		static public const UP:String = "_up";

		public function GameDoc(){
			addEventListener(MENU, setupMenu,false,0,true);
			addEventListener(GAME, setupGame,false,0,true);
			addEventListener(END, setupEnd,false,0,true);
		}
		
		private function setupMenu(e:Event){
			menu_button.button_text.text = "Start";
			menu_button.addEventListener(MouseEvent.MOUSE_OUT, aMouseOut);
			menu_button.addEventListener(MouseEvent.MOUSE_OVER, aMouseOver);
			menu_button.addEventListener(MouseEvent.CLICK, aClick,false,0,true);
		}
		
		private function setupGame(e:Event){
			end_button.button_text.text = "Win";
//			end_button.addEventListener(MouseEvent.MOUSE_OUT, bMouseOut);
//			end_button.addEventListener(MouseEvent.MOUSE_OVER, bMouseOver);
//			end_button.addEventListener(MouseEvent.CLICK, bClick,false,0,true);
			
		}
		private function setupEnd(e:Event){
			start_button.button_text.text = "Menu";
//			start_button.addEventListener(MouseEvent.MOUSE_OUT, cMouseOut);
//			start_button.addEventListener(MouseEvent.MOUSE_OVER, cMouseOver);
//			start_button.addEventListener(MouseEvent.CLICK, cClick,false,0,true);
			
		}
		
		//START BUTTON events
		private function aClick(e:Event){
			menu_button.gotoAndPlay(CLICK);
			gotoAndPlay(GAME);
		}
		
		//On mouse out function
		private function aMouseOut(event:MouseEvent):void {
			menu_button.gotoAndPlay(UP);
		}
		//On mouse over function
		private function aMouseOver(event:MouseEvent):void {
			menu_button.gotoAndPlay(OVER);
		}
		
//		//WIN BUTTON events
//		private function bClick(e:Event){
//			end_button.gotoAndPlay(CLICK);
//			gotoAndPlay(END);
//		}
//
//		//On mouse out function
//		private function bMouseOut(event:MouseEvent):void {
//			end_button.gotoAndPlay(UP);
//		}
//		//On mouse over function
//		private function bMouseOver(event:MouseEvent):void {
//			end_button.gotoAndPlay(OVER);
//		}
//		
//		// END BUTTON events
//		private function cClick(e:Event){
//			start_button.gotoAndPlay(CLICK);
//			gotoAndPlay(MENU);
//		}
//
//		//On mouse out function
//		private function cMouseOut(event:MouseEvent):void {
//			start_button.gotoAndPlay(UP);
//		}
//		//On mouse over function
//		private function cMouseOver(event:MouseEvent):void {
//			start_button.gotoAndPlay(OVER);
//		}
		
	}
}